import request from '@/utils/request'

// 查询答题活动列表
export function listTrainActivity(query) {
  return request({
    url: '/question/trainActivity/list',
    method: 'get',
    params: query
  })
}

// 查询答题活动详细
export function getTrainActivity(id) {
  return request({
    url: '/question/trainActivity/' + id,
    method: 'get'
  })
}

// 新增答题活动
export function addTrainActivity(data) {
  return request({
    url: '/question/trainActivity',
    method: 'post',
    data: data
  })
}

// 修改答题活动
export function updateTrainActivity(data) {
  return request({
    url: '/question/trainActivity',
    method: 'put',
    data: data
  })
}

// 删除答题活动
export function delTrainActivity(id) {
  return request({
    url: '/question/trainActivity/' + id,
    method: 'delete'
  })
}

// 处理答题结果
export function buildResult(id) {
  return request({
    url: '/question/trainActivity/handle/result/' + id,
    method: 'get'
  })
}
